<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			/*
		    1.参数默认值
			2.不定参数(只能放在最后,且只有一个)
		
		   */
			function add(x, y = 6, ...z) {
				// arguments
				return x + y;
			}

			console.log(add(1, 2)); //3
			console.log(add(1)); //7
			console.log(add(1, 2, 3));
		</script>
	</body>
</html>
